package fatworm.query.constant;

public class FloatConstant implements Constant {
	
	private Float val;
	
	public FloatConstant(Float val) {
		this.val = val;
	}
	
	public Object asJavaVal() {
		return val;
	}
	
	public boolean equals(Object obj) {
		FloatConstant fc = (FloatConstant)obj;
		if (fc != null && val.equals(fc.val))
			return true;
		else
			return false;
	}
	
	public int compareTo(Constant c) {
		FloatConstant fc = (FloatConstant)c;
		return val.compareTo(fc.val);
	}
	
	public int hashCode() {
		return val.hashCode();
	}
	
	public String toString() {
		return val.toString();
	}
	
	public Constant plus(Constant c) {
		FloatConstant fc = (FloatConstant)c;
		return new FloatConstant(val + fc.val);
	}
}